<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<!--驳回原因-->
<div class="modal fade" id="modal-create">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">驳回</h4>
            </div>
            <div class="modal-body">
                <form id="rejectForm" class="form-horizontal" role="form">
                    <input id="proId" type="hidden" th:value="${proJect.id}" name="proId">
                    <input id="createCode" type="hidden" name="createCode">
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right">驳回原因</label>
                        <div class="col-sm-10">
                            <textarea rows="3" class="form-control" name="rejectReason"
                                      placeholder="请输入驳回原因"></textarea>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<section class="content-header">
    <h1>产品结构查询</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-body">
                    <h4>项目信息</h4>
                    <div class="row">
                        <div class="col-md-3">
                            <div class="form-group">
                                <label>项目编号：</label><label th:text="${proJect.proCode}"></label>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label>项目名称：</label><label th:text="${proJect.proName}"></label>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label>数量：</label><label th:text="${proJect.proNum}"></label>
                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="form-group">
                                <label>需方：</label><label th:text="${proJect.demander}"></label>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="form-inline">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label th:text="'分配科室：'+${proJect.depts}"></label>
                                </div>
                            </div>
                        </div>
                    </div>
                    <h4>产品结构</h4>
                    <table id="bootstrap-table" style="width: 99.9%;"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    var table;
    $(function () {
        /** 产品结构列表 */
        table = js.table.init({
            url: ctx + "designTask/proStruct/proStructCheckList",
            // onLoadSuccess: function (data) {
            //     mergeCells(data, "createName", "operate", 1, $('#bootstrap-table')); //合并单元格
            // },
            showExport: false,
            pagination: false,
            queryData: {proId: $("#proId").val()},
            columns: [
                {
                    title: '序号',  field: 'id',  width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "类型", field: 'special'},
                {title: "产品结构名称", field: 'proPart'},
                {title: "创建人", field: 'createName'},
                {title: "创建时间", field: 'createTime'},
                {
                    title: "状态", field: 'status',
                    formatter: function (value) {
                        if (value === 1) {
                            return '<span class="badge label-inverse">未提交</span>';
                        } else if (value === 2) {
                            return '<span class="badge label-success">已提交</span>';
                        } else if (value === 3) {
                            return '<span class="badge label-success">已审核</span>';
                        }
                    }
                },
                // {
                //     title: "操作", field: 'operate', width: '110',
                //     formatter: function (value, row) {
                //         let actions = [];
                //         if (hasP('dsn:proCheck:check') && row.status === 2) {
                //             actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="openRejectReason(' + js.jsonStringify(row) + ')"> 驳回</a> ');
                //         }
                //         return actions.join('');
                //     }
                // }
            ]
        });
    });


</script>
</body>
</html>
